Conditions | 3 |
Total Lines | 20 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 20 |
CRAP Score | 3 |
Changes | 0 |
1 | 1 | import type { ComponentOptionsMixin, CreateComponentPublicInstance } from 'vue'; |
|
9 | 1 | created(this: CreateComponentPublicInstance) { |
|
10 | 7 | const { title } = this.$options; |
|
11 | 7 | ||
12 | 7 | if (title === undefined) { |
|
13 | 3 | return; |
|
14 | 3 | } |
|
15 | 3 | ||
16 | 3 | // allow use dinamic title system |
|
17 | 7 | if (isFunction(title)) { |
|
18 | 2 | this.$watch( |
|
19 | 2 | () => title.call(this, this), |
|
20 | 2 | (val: string) => { |
|
21 | 3 | this.$setPageTitle(val); |
|
22 | 3 | }, |
|
23 | 2 | { immediate: true } |
|
24 | 2 | ); |
|
25 | 2 | return; |
|
26 | 2 | } |
|
27 | 2 | ||
28 | 2 | this.$setPageTitle(title); |
|
29 | 2 | }, |
|
33 |